package com.wzy.controller;

import com.wzy.pojo.Department;
import com.wzy.service.DepartmentService;
import com.wzy.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/department")
public class DepartmentController {
    @Autowired
    private DepartmentService departmentService;

    /**
     * 查询所有部门列表
     *
     * @return
     */
    @GetMapping("/departmentList")
    public Result departmentList() {
        List<Department> departmentList = departmentService.departmentList();
        Result result = new Result(departmentList);
        return result;

    }

}
